#include "StdAfx.h"
#include "connector_fence.h"
#include "tools.h"


connector_fence::connector_fence(void)
{
}


connector_fence::~connector_fence(void)
{
}

void connector_fence::draw_element(float* cur_position, float* previous_position, 
									float* cur_delta, float* previous_delta)
{

	float start_point[3];
	float end_point[3];

	start_point[0] = cur_position[0] + cur_delta[0];
	start_point[1] = cur_position[1] + cur_delta[1] + 0.2f;
	start_point[2] = cur_position[2] + cur_delta[2];

	end_point[0] = previous_position[0] + previous_delta[0];
	end_point[1] = previous_position[1] + previous_delta[1] + 0.2f;
	end_point[2] = previous_position[2] + previous_delta[2];

	draw_cylinder(start_point, end_point, 0.01, SECTION_DIRECTION_XZ, true);

	start_point[0] = cur_position[0] - cur_delta[0];
	start_point[1] = cur_position[1] + cur_delta[1] + 0.2f;
	start_point[2] = cur_position[2] - cur_delta[2];

	end_point[0] = previous_position[0] - previous_delta[0];
	end_point[1] = previous_position[1] + previous_delta[1] + 0.2f;
	end_point[2] = previous_position[2] - previous_delta[2];

	draw_cylinder(start_point, end_point, 0.01, SECTION_DIRECTION_XZ, true);
}